package com.mc.algorithm;

public class LastKey {
	
	public static void main(String[] args){
		
	}
	
	public static Node find(Node node,int k){
		if(node==null)
			return null;
		Node p1 = node;
		while(k>1&&p1!=null){
			p1 = p1.next;
			k--;
		}
		if(p1==null)
			return null;
		Node p2 = node;
		while(p1!=null){
			p2=p2.next;
			p1=p1.next;
		}
		return p2;
		
	}
	
	
	static class Node{
		Node next;
		int value;
	}
}
